import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonReader;
import org.bukkit.Bukkit;
import org.json.simple.JSONObject;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.math.*;
import java.util.*;
import java.io.InputStreamReader;
import java.security.MessageDigest;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class test {
    public static String getTime(String e){
        String res;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
        long lt = new Long(e);
        Date date = new Date(lt);
        res = simpleDateFormat.format(date);
        return res;
    }


    public static void main(String[] args){
        System.out.println(String.valueOf(System.currentTimeMillis()));
        System.out.println(getTime(String.valueOf(System.currentTimeMillis())));
        try {
            String u = "http://api2.yy2169.com:52888/creat_order/?id=137639&token=8rMxDivbRLXGXmo78cVcrCqbEjfirSWa&price=22&pay_id=ME_shitous&type=2&page=4&param=ME_shitous_15454075745s89";
            URL url = new URL(u);
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            String line = in.readLine();
            //Bukkit.getConsoleSender().sendMessage(line);
            in.close();

            String finalLine = line;

            JsonObject jsonObject = (JsonObject) new JsonParser().parse(finalLine).getAsJsonObject();




           System.out.println(jsonObject.get("qrcode").getAsString());


        }
        catch (MalformedURLException e) {
            System.out.println("Malformed URL: " + e.getMessage());
        }
        catch (IOException e2) {
            System.out.println("I/O Error: " + e2.getMessage());
        }



    }
}
